<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="DecisionMaking.Domain" %>
<%@ Import Namespace="MvcContrib.UI.Grid" %>
<asp:Content ContentPlaceHolderID="TitleContent" runat="server">My Environments</asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
	<ul class="action-menu clearfix">
		<li><%= Html.ActionLink("New Environment", "Add") %></li>
		<li><%= Html.ActionLink("New Environment from CSV file", "Import") %></li>
	</ul>
	<%Html.Grid<DecisionMaking.Domain.Environment>("environments").Columns( column => {
		column.For(e => e.Name);
        column.For(e => Html.ActionLink("Run", "Run", "Simulation", new { id = e.Id }, null)).CellCondition(e => e.Status == Status.ACTIVE).Named("Simulation").DoNotEncode();
		column.For(e => Html.ActionLink("Edit", "Edit", new {id = e.Id})).CellCondition(e => e.Account.Equals(ViewData["currentAccount"])).DoNotEncode();
	}).Render();%>

</asp:Content>